// 定义类注册表
import {MachineObserverBiz} from "@/utils/biz/machine/MachineObserverBiz";

/**
 * 报到机业务枚举类
 */
const MachineClassRegistry = {
  // 通用报到机业务逻辑
  MachineObserverBiz: MachineObserverBiz,
  // 扩展其他类
};
/**
 * 动态注册
 * @param className
 * @param args
 * @returns {*|MachineObserverBiz}
 */
const createMachineInstance = (className = 'MachineObserverBiz', ...args) => {
  const Constructor = MachineClassRegistry[className];
  if (Constructor && typeof Constructor === "function") {
    return new Constructor(...args);
  }
  // 没找到类就执行自定义逻辑
  return new MachineObserverBiz(...args)
}

export {createMachineInstance}

